import '~/style/list.less'
import LoadHead from '~/js/loadHead.js'

class List extends LoadHead{
  constructor () {
    super()
    this.init()
  }
  init () {
    console.log("列表")
    this.loadList()
  }
  loadList () {
    const data = [
      {
        name: '数据1',
        value: 1
      },
      {
        name: '数据2',
        value: 2
      },
      {
        name: '数据2',
        value: 3
      }
    ]
    let listHtml = ''
    data.forEach((item, index) => {
      const {name, value} = item
      listHtml += `<div class="list-item">
            <span class="number">${index}</span>
            <div class="name">${name}</div>
            <span>${value}</span>
          </div>`
    })
    $('#listDemo').append(listHtml)
  }

}

new List()



